# encoding: utf-8
from flask_marshmallow import base_fields
from app.modules.common.parameters import Parameters


class TableGetParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )
    tableName = base_fields.String(
        description = "",
        required = False,
        missing = None
    )


class TableCheckrowGetParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )
    tableName = base_fields.String(
        description = "",
        required = True
    )
    isCheckRows = base_fields.String(
        description = "Y or N",
        required = False,
        missing = None
    )
    isNeedClean = base_fields.String(
        description = "Y or N",
        required = False,
        missing = None
    )


class ListGetParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )


class ExportGetParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )
    tableName = base_fields.String(
        description = "表名",
        required = True
    )


class ExportPostParameters(Parameters):
    table_schema = base_fields.String(
        description = "数据库名",
        required = True
    )
    table_name = base_fields.String(
        description = "表名",
        required = True
    )
    env_type = base_fields.String(
        description = "环境类型",
        required = True
    )
    script = base_fields.String(
        description = "脚本",
        required = True
    )
    remark = base_fields.String(
        description = "说明",
        required = False,
        missing = None
    )
    updatedby = base_fields.String(
        description = "修改人",
        required = True
    )


class CleanPostParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )
    tableName = base_fields.String(
        description = "表名",
        required = True
    )
    list = base_fields.String(
        description = "环境类型",
        required = True
    )


class CheckRowPostParameters(Parameters):
    id = base_fields.String(
        description = "id",
        required = False,
        missing = None
    )
    table_schema = base_fields.String(
        description = "数据库名",
        required = True
    )
    table_name = base_fields.String(
        description = "表名",
        required = True
    )
    checkedby = base_fields.String(
        description = "",
        required = True
    )
    this_rows = base_fields.String(
        description = "",
        required = True
    )
    checked_rows = base_fields.String(
        description = "",
        required = True
    )
    remark = base_fields.String(
        description = "",
        required = False,
        missing = None
    )


class InitGetParameters(Parameters):
    schemaName = base_fields.String(
        description = "数据库名",
        required = True
    )
    envType = base_fields.String(
        description = "类型",
        required = False,
        missing = None
    )


class InitPostParameters(Parameters):
    id = base_fields.String(
        description = "id",
        required = True
    )
    table_schema = base_fields.String(
        description = "数据库名",
        required = True
    )
    table_schema_instance = base_fields.String(
        description = "",
        required = True
    )
    env_type = base_fields.String(
        description = "",
        required = True
    )
    script = base_fields.String(
        description = "",
        required = True
    )
    remark = base_fields.String(
        description = "",
        required = True
    )
    is_active = base_fields.String(
        description = "",
        required = True
    )
    updatedby = base_fields.String(
        description = "",
        required = True
    )
